package expertise.security.authentication.user;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

public class ExpertiseUserHolder {

    public ExpertiseUser getUser() {
        final Authentication auth = SecurityContextHolder.getContext().getAuthentication();
        if (auth != null) {
            return (ExpertiseUser) auth.getPrincipal();
        } else {
            return null;
        }
    }

}
